<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<c:set value="${requestScope.response.data.list }" var="list"/>
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>购物车列表 - 美妆产品销售系统</title>
		<%@ include file="/common/include/head_title.jsp"%>
	</head>
	<body>
		<jsp:include page="/header.htm"></jsp:include>
		<div id="mainBody">
			<div class="container">
				<div class="row">
					<%@ include file="/common/include/leftBar.jsp"%>
					<div class="span9">
						<ul class="breadcrumb">
							<li><a href="${rootPath }/IndexHeadServlet?method=main">首页</a><span class="divider">/</span></li>
							<li class="active">我的购物车</li>
						</ul>
						<table class="table table-bordered">
							<thead>
								<tr>
									<th>序号</th>
									<th>商品</th>
									<th>单价</th>
									<th>数量</th>
									<th>总金额</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								<c:set value="0" var="totalMoney"/>
								<c:forEach items="${list }" var="listTemp" varStatus="stat">
									<tr>
										<td>${stat.count }</td>
										<td title="${listTemp.goods.name }">
											<a href="${rootPath }/goodsInfo.htm?id=${listTemp.goodsId}" target="_blank" title="${listTemp.title }">
												${fn:substring(listTemp.goods.name,0,subStrLen) }
											</a>
										</td>
										<td>${listTemp.goods.price }</td>
										<td>${listTemp.num }</td>
										<td>${listTemp.goods.price * listTemp.num }</td>
										<td>
											<a onclick="return confirm('确认要删除吗?')" href="${rootPath }/head/users/cartDelete.htm?id=${listTemp.id}" class="btn btn-danger">
												<i class="icon-remove icon-white"></i>
											</a>
										</td>
										<c:set value="${totalMoney + listTemp.goods.price * listTemp.num }" var="totalMoney"/>
									</tr>
								</c:forEach>
								<tr>
									<td colspan="5" style="text-align: right">
										<strong>总价格 =</strong></td>
									<td class="label label-important" style="display: block">
										<strong>${totalMoney }</strong></td>
								</tr>
							</tbody>
						</table>
						<a href="${rootPath }/goodsList.htm" class="btn btn-large"><i class="icon-arrow-left"></i> 继续购物 </a>
						<a href="${rootPath }/head/orders/ordersInsert.htm" class="btn btn-large pull-right">下单 <i class="icon-arrow-right"></i></a>
					</div>
				</div>
			</div>
		</div>
		<%@ include file="/common/include/head_footer.jsp"%>
	</body>
</html>